#include "common.h"

#ifndef __NET_SESSION__
#define __NET_SESSION__

namespace GXL_Engine
{

class ServerSession;

class Acceptor
{
public:
	BOOL			Init(LPCSTR szIP, INT16 n16Port);
	ServerSession*	Accept();
	VOID			Close();
private:
	SOCKET			m_sListen;
};
class Session
{
public:
	UINT32	Send(BYTE* pData, UINT32 dwDataSize);
	UINT32	Receive(BYTE* pBuffer, UINT32 dwBufferSize);
	VOID	Close();
	BOOL	IsValid();

protected:
	Session(){}
	Session(SOCKET Socket)
		:m_Socket(Socket){}
	virtual ~Session(){}
	SOCKET	m_Socket;
};
class ServerSession : public Session
{
public:
	ServerSession(SOCKET sClient)
		:Session(sClient){}
	UINT32 GetPeerIp()
	{
		
	}
};

class ClientSession : public Session
{
public:
	ClientSession(){}
	BOOL Connect(LPCSTR szIP, INT16 n16Port);
};
VOID InitNetSession();
VOID DestroyNetSession();
}//GXL_Engine

#endif//__NET_SESSION__